package com.angenela.imageshare.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonUtil {

    private static final ObjectMapper instance = new ObjectMapper();

    public static <T> T jsonToObject(Class<?> clazz, String json) throws JsonProcessingException {
        return (T) instance.readValue(json, clazz);
    }
}

